package com.cxl.controller;

import com.cxl.entity.Category;
import com.cxl.entity.Good;
import com.cxl.repository.CategoryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 20971
 * @time: 2022/3/2 15:41
 * @description:
 */
@RestController
@RequestMapping(value = "/category")
public class CategoryController {

    @Autowired
    private CategoryRepository categoryRepository;

    @GetMapping(value = "/categorylist")
    private List<Category> categoryList() {
        return categoryRepository.findAll();
    }
}
